package com.learn.finished;

public class num_Interview53_1 {
    public static void main(String[] args) {
        int[] a ={5,7,7,8,8,10};
        System.out.println(search(a,6));
    }
    public static int oldSearch(int[] nums, int target) {
        int candidate=0;
        for (int num : nums) {
            if (num==target){
                candidate++;
            }
        }
        return candidate;
    }
    public static int search(int[] nums, int target) {
        int low=0,high=nums.length-1;
        if ( low < high ) {

            low++;
            high--;
        }
        return 0 ;
    }
}
